package com.bocloud.service;

import com.bocloud.mappers.MenuMapper;
import com.bocloud.model.Menu;
import com.bocloud.util.TreeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by Administrator on 2018/12/16.
 */
@Service
public class MenuServiceImp implements MenuService {


    @Autowired
    private MenuMapper menuMapper;


    /**
     * 用途：获取菜单表中的所有数据
     *
     * @param
     * @return Menu
     */
    @Transactional(value = "loginTransactionManager")
    @Override
    public List<Menu> getAllMenu() {
        return TreeUtil.buildByMenu(menuMapper.getAll());
    }
}
